'use strict'

/**
 * The persistent session class.
 * This is the decorate of backend session. It will call the backend session to
 * process all requests.
 *
 * @public
 */
class Session {
    /**
     * The constructor of class.
     *
     * @public
     * @param {backend/Session} [backendSession] - The backend session.
     */
    constructor(backendSession) {
        this.backendSession = backendSession;
    }

    /**
     * Get the DAO(Data Access Object) of session for specified model.
     *
     * @public
     * @param {class<Model>} [uniqueModel] The unique model class.
     */
    getDao(uniqueModel) {
        return this.backendSession.getDao(uniqueModel);
    }
}

module.exports = {
    Session
};
